<template>
  <div>
    <module-manager-table ref="mmt" :type="1" :menuId="this.$route.query.id" v-on:listenToChildNewButtonEvent="newButtonEventFromChild" v-on:listenToChildEditButtonEvent="editButtonEventFromChild"></module-manager-table>
    <module-manager-dialog ref="mmd" v-on:fmModuleToRefreshTable="fmModuleToRefreshTable"></module-manager-dialog>
  </div>
</template>

<script>
  import moduleManagerTable from '@/view/moduleManager/moduleManagerTable.vue'
  import moduleManagerDialog from '@/view/moduleManager/moduleManagerDialog.vue'

  export default {
    components: {
      'module-manager-table': moduleManagerTable,
      'module-manager-dialog': moduleManagerDialog
    },
    data () {
      return {
      }
    },
    methods: {
      // 编辑（fromChild）
      editButtonEventFromChild (data) {
        this.$refs.mmd.modifyModuleDialog(data)
      },
      // 新建（fromChild）
      newButtonEventFromChild () {
        this.$refs.mmd.createModuleDialog()
      },
      // 刷新表
      fmModuleToRefreshTable () {
        this.$refs.mmt.refreshTable()
      }
    }
  }
</script>
